home *** CD-ROM | disk | FTP | other *** search
- Path: severus.mbfys.kun.nl!rhialto
- From: rhialto@mbfys.kun.nl (Olaf Seibert)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: x ^= y ^= x ^= y;
- Date: 23 Feb 1996 21:44:07 GMT
- Organization: University of Nijmegen, The Netherlands
- Distribution: world
- Message-ID: <4glcf7$eou@wn1.sci.kun.nl>
- References: <1286.6624T1439T237@cs.ruu.nl>
- NNTP-Posting-Host: severus.mbfys.kun.nl
-
- In <1286.6624T1439T237@cs.ruu.nl> wsldanke@cs.ruu.nl (Wessel Dankers) writes:
- >Which can of course be rewritten as:
- >
- > x ^= y;
- > y ^= x;
- > x ^= y;
- >
- >or if you want it real fancy:
- >
- > x ^= y ^= x ^= y;
-
- No. you can't do this last step. You are modifying the same variable
- (two variables even) twice between sequence points.
-
- -Olaf.
- --
- ___ Olaf 'Rhialto' Seibert rhialto@mbfys.kun.nl The only excuse
- \X/ for making a useless thing is that one admires it intensely. -O.W.
-